{include file="public/header" /}
<style>
  .padclass {
    padding: 0 10px
  }
</style>

<body>
  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md12">
        <div class="layui-card">
          <div class="layui-card-body">
            <fieldset id="searchFieldset_currentTableRenderId" class="table-search-fieldset">
              <legend>条件搜索</legend>
              <form class="layui-form layui-form-pane form-search">
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">内外勤类型</label>
                  <div class="layui-input-inline">
                    <select name="type">
                      <option value="">内外勤类型</option>
                      <option value="1" {if !empty(input('get.type')) && input('get.type')==1}selected{/if}>内勤</option>
                      <option value="2" {if !empty(input('get.type')) && input('get.type')==2}selected{/if}>外勤
                      </option>
                    </select>
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">补卡类型</label>
                  <div class="layui-input-inline">
                    <select name="buka">
                      <option value="">补卡类型</option>
                      <option value="1" {if !empty(input('get.buka')) && input('get.buka')==1}selected{/if}>正常打卡
                      </option>
                      <option value="2" {if !empty(input('get.buka')) && input('get.buka')==2}selected{/if}>补卡申请
                      </option>
                      <option value="99" {if !empty(input('get.buka')) && input('get.buka')==99}selected{/if}>超期打卡
                      </option>
                      <option value="100" {if !empty(input('get.buka')) && input('get.buka')==100}selected{/if}>外勤无任务卡
                      </option>
                    </select>
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">打卡状态</label>
                  <div class="layui-input-inline">
                    <select name="status">
                      <option value="">打卡状态</option>
                      <option value="1" {if !empty(input('get.status')) && input('get.status')==1}selected{/if}>待审核
                      </option>
                      <option value="2" {if !empty(input('get.status')) && input('get.status')==2}selected{/if}>正常打卡
                      </option>
                      <option value="3" {if !empty(input('get.status')) && input('get.status')==3}selected{/if}>驳回
                      </option>
                      <option value="4" {if !empty(input('get.status')) && input('get.status')==4}selected{/if}>撤销
                      </option>
                    </select>
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">上下班类型</label>
                  <div class="layui-input-inline">
                    <select name="monoraft">
                      <option value="">上下班类型</option>
                      <option value="1" {if !empty(input('get.monoraft')) && input('get.monoraft')==1}selected{/if}>上班
                      </option>
                      <option value="2" {if !empty(input('get.monoraft')) && input('get.monoraft')==2}selected{/if}>下班
                      </option>
                    </select>
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">打卡督导</label>
                  <div class="layui-input-inline">
                    <select name="user_id" lay-search="">
                      <option value="">督导</option>
                      {foreach $dlist as $k => $v}
                      {if $v.del == 1}
                      <option value="{$v.id}" {if !empty(input('get.user_id')) &&
                        input('get.user_id')==$v.id}selected{/if}>
                        {$v.account|default=''}{if $v.del !=
                        1}账号已删除{/if}</option>
                      {/if}
                      {/foreach}
                    </select>
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <label class="layui-form-label">打卡日期</label>
                  <div class="layui-input-inline">
                    <input type="text" id="dates" name="dates" placeholder="打卡日期" value="{:input('get.dates')}"
                      autocomplete="off" class="layui-input" />
                  </div>
                </div>
                <div class="layui-form-item layui-inline">
                  <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
                    搜索
                  </button>
                </div>
              </form>
            </fieldset>
          </div>
          <div class="layui-card-body layui-row layui-col-space10">
            <!-- <button class="layui-btn layui-bg-cyan layui-btn-sm" onclick="open_add('添加用户','user_edit')">
              添加用户
            </button> -->
            <!-- <button class="layui-btn layui-bg-cyan layui-btn-sm" lay-submit="" lay-filter="daochu">
              导出打卡
            </button> -->
            <!-- <a title="导出打卡" href="/shop/usersignexcel?id={:input('get.id')}&dates={:input('get.dates')}"
              class="layui-btn layui-btn-sm">
              导出打卡
            </a> -->
            共有数据：<strong id="count">{$list->total()}</strong> 条
          </div>
          <div class="layui-table-body layui-table-main">
            <table class="layui-table">
              <thead>
                <tr>
                  <th width="50">
                    <div class="layui-table-cell">ID</div>
                  </th>
                  <th width="100">
                    <div class="layui-table-cell">打卡人</div>
                  </th>
                  <th width="100">
                    <div class="layui-table-cell">上下班/内外勤/是否补卡</div>
                  </th>
                  <th width="200">
                    <div class="layui-table-cell">打卡地址</div>
                  </th>
                  <th width="200">
                    <div class="layui-table-cell">拍照/性质/打卡地址/打卡用户/关联订单</div>
                  </th>
                  <th width="150">
                    <div class="layui-table-cell">打卡(补卡)日期/打卡时间</div>
                  </th>
                  <th width="200">
                    <div class="layui-table-cell">状态|操作</div>
                  </th>
                </tr>
              </thead>
              <tbody>
                {foreach $list as $v}
                <tr>
                  <td>
                    <div class="layui-table-cell">{$v.id}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.user_name}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">
                      {if $v.monoraft == 1}上班{else}下班{/if}|
                      {if $v.type == 1}内勤{else}外勤{/if}|
                      {if $v.buka == 2}补卡申请{elseif $v.lianxu == 2}超期打卡{else}正常打卡{/if}
                    </div>
                  </td>
                  <td>
                    <div class="padclass">{$v.address}</div>
                  </td>
                  <td>
                    {if count($v.images) > 0}
                    <div id="layer-photos-demo" class="layer-photos-demo">
                      {foreach $v.images as $m}
                      <img height="200" layer-pid="" layer-src="{$m.url}" src="{$m.url}" />
                      {/foreach}
                    </div>
                    {/if}
                    {if $v.iswei == 1}
                    <a title="照片违规标记" onclick="open_status(this, '/shop/signwei', '{$v.id}', 2)" href="javascript:;"
                      class="layui-btn layui-btn-sm layui-btn-danger">
                      标记照片违规
                    </a>
                    {else}
                    <a title="违规标记撤回" onclick="open_status(this, '/shop/signwei', '{$v.id}', 1)" href="javascript:;"
                      class="layui-btn layui-btn-sm">
                      撤回违规标记
                    </a>
                    {/if}
                    {if !empty($v.texts)}<div class="layui-table-cell">{$v.texts|default='无'}</div>{/if}
                    {if !empty($v.btname)}<div class="layui-table-cell">{$v.btname|default='无'}</div>{/if}
                    {if !empty($v.btaddress)}<div class="layui-table-cell">{$v.btaddress|default='无'}</div>{/if}
                    {if $v.orderid > 0}
                    <a title="查看任务单" onclick="open_add4('编辑','/shop/shoplist?id={$v.orderid}')" href="javascript:;"
                      class="layui-btn layui-btn-sm">
                      查看任务单
                    </a>
                    {/if}
                  </td>
                  <td>
                    <div class="layui-table-cell">{$v.yearday}</div>
                    <div class="layui-table-cell">{$v.created|default="无"}</div>
                  </td>
                  <td>
                    <div class="layui-table-cell">
                      {if $v.status == 1}
                      <a title="确认操作" onclick="open_status(this, '/shop/postsignstatus', '{$v.id}', 2)"
                        href="javascript:;" class="layui-btn layui-btn-sm  layui-bg-blue">
                        {if $v.lianxu == 2}超期打卡通过{elseif empty($v.orderid)}无任务外勤卡通过{else}补卡通过{/if}
                      </a>
                      <a title="确认操作" onclick="open_status(this, '/shop/postsignstatus', '{$v.id}', 3)"
                        href="javascript:;" class="layui-btn layui-btn-sm">
                        驳回
                      </a>
                      {elseif $v.status == 2}正常{elseif $v.status == 3}补卡失败{elseif $v.status == 4}撤回{/if}
                    </div>
                  </td>
                </tr>
                {/foreach}
              </tbody>
            </table>
          </div>
          <div class="layui-card-body">
            <div class="page">{$list->render()|raw}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  {include file="public/footer"}
  <script>
    layui.use(['form', 'layer', 'laydate'], function () {
      $ = layui.jquery;
      var laydate = layui.laydate;
      var form = layui.form
        , layer = layui.layer;
      laydate.render({
        elem: '#dates' //指定元素
        , type: 'day'
      });
    });
  </script>
</body>